package org.lewis.man.controllers;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.lewis.common.service.TagService;

import com.tocersoft.framework.core.annotations.Controller;
import com.tocersoft.framework.core.annotations.Injection;
import com.tocersoft.framework.web.annotations.Mapping;
import com.tocersoft.framework.web.annotations.NameSpace;
import com.tocersoft.framework.web.renderer.Renderer;
import com.tocersoft.framework.web.renderer.TemplateRenderer;

/**
 * 标签
 * 
 * @author taiqichao
 * 
 */
@Controller
@NameSpace("/tag")
public class TagIndexController {

	private final static String V = "/WEB-INF/views/music/tag/";

	Log log = LogFactory.getLog(TagIndexController.class);
	
	@Injection
	private TagService tagService;
	
	/**
	 * 标签列表页
	 * @return
	 * @throws Exception
	 */
	@Mapping("")
	public Renderer taglist() throws Exception {
		Map<String ,Object> data=new HashMap<String, Object>();
		data.put("tags0", tagService.queryByType(0));
		data.put("tags1", tagService.queryByType(1));
		data.put("tags2", tagService.queryByType(2));
		return new TemplateRenderer(V+"tag_list.vm",data);
	}
	


}
